package ee.falcon.xml;

import java.util.Map;

public class ProfileInfoList 
{	
	private Map<String, SpecificProfileInfo> specificProfiles;
	private static final String FALCON_PROFILEINFO_FILEPATH = "data/profileInfo.xml";
	private ProfileInfoXMLReader xmlReader;
	
	public ProfileInfoList(Map<String, SpecificProfileInfo> specificProfilesHashMap)
	{
		this.specificProfiles = specificProfilesHashMap; 
		makeNewProfileInfoXMLReader(); 
		xmlReader.readFromProfileInfoXML(FALCON_PROFILEINFO_FILEPATH); //to get xml file and fill the HashMap
	}
	
	public Map<String, SpecificProfileInfo> getProfileInfoHashMap()
	{
		return this.specificProfiles; 
	}
	
	public void setSpecificProfileInfo(
			Map<String, SpecificProfileInfo> specificProfiles) 
	{
		this.specificProfiles = specificProfiles;
	}

	public ProfileInfoXMLReader getProfileInfoXMLReader()
	{
		return this.xmlReader; 
	}
	
	public void setProfileInfoXMLReader(ProfileInfoXMLReader xmlReader) 
	{
		this.xmlReader = xmlReader;
	}

	public void renewData()
	{
		xmlReader.readFromProfileInfoXML(FALCON_PROFILEINFO_FILEPATH); 
	}
	
	public void makeNewProfileInfoXMLReader()
	{
		xmlReader = new ProfileInfoXMLReader(specificProfiles);	
	}
}
